Conversation
|
This interface should be relatively similar to the Notes
|
I think this is a slight simplification - teardown should just happen after the stop event is triggered.
I thought about this for a bit and realized that a simple |
This can't always occur though. For example, in the case of the user closing their browser window. We need a timeout to cover edge cases like this.
We can call it
What you proposed isn't equivalent to a |
|
Both comments seem to address the fact that we might want to enforce a timeout when a connection is closed. That seems reasonable, but in that case, it seems better to introduce that timeout here when a Though, even without this, the user could enforce a "stop timeout" themselves if they wanted: |
f3d4405 to
be5cf27
Compare
|
So thinking through our interface some more I'm realizing that: Is not correct since simply cancelling a task does not mean that it will have exited by the time This is far too complicated for users to understand. As such, I've done some thinking and realized that in 3.11 The behavior is that awaitables within the The implementation of the |
|
Is there any way for us to use Python 3.11 asyncio features in older versions? I'm pretty sure the answer is no, and if so what do we want to do in the interim while we wait for 3.11 to become our minimum version? |
|
I'll have to play around with whether this can be achieved with |
|
If we're going to introduce async specific Such as |
3550cbf to
3d81311
Compare
00c5830 to
72d4d66
Compare
72d4d66 to
4ee124c
Compare
|
Limiting the default python version to 3.11 seems to have fixed it. |
8ee3e6a to
b389b2b
Compare
f546794 to
3fe82fa
Compare
|
I'm going to close this and break up the changes into two parts:
|
By submitting this pull request you agree that all contributions to this project are made under the MIT license.
Issues
Closes: #956
Solution
Async effects now accept a "stop"
Eventthat is set when an effect needs to be re-run or a component is unmounting. The next effect will only run when the last effect has exited.Implementing this same behavior using sync effects is quite challenging:
To achieve this without requiring an implementation similar to the above, we've asyncified the internals of
Layout. This has the side-effect of allowing other things to happen while theLayoutis rendering (e.g. receive events, or allowing the server to respond to other requests). This potentially comes at the cost of rendering speed. For example, if a user is spamming the server with events renders may be interrupted in order to respond to them.Checklist
changelog.rsthas been updated with any significant changes.